package operator;

public class OUtil {

    private static OUtil outil;
    private OUtil() {}
    public static OUtil getUtil() {
        if(outil == null) {
            outil = new OUtil();
        }
        return outil;
    }

    /**
     * 获取去除向TextPane中添加文字时自动出现的回车(13)
     */
    public String getTextExcepted13(String text) {
        StringBuilder toReturn = new StringBuilder();
        for (int i = 0; i < text.length(); i++) {
            if (text.charAt(i) != 13)
                toReturn.append(text.charAt(i));
        }
        return toReturn.toString();
    }
}
